package com.cyzy.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.cyzy.pojo.Adopt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 认养Mapper接口
 */
@Mapper
public interface AdoptMapper extends MPJBaseMapper<Adopt> {
    
    /**
     * 使用悲观锁查询认养商品信息
     * @param adoptId 认养商品ID
     * @return 认养商品信息
     */
    @Select("SELECT * FROM adopt WHERE adopt_id = #{adoptId} AND adopt_status = 1 FOR UPDATE")
    Adopt selectByIdForUpdate(Long adoptId);
} 